<template>
  <div>
    <div>我是第二个子组件2222</div>
    <p>{{msg}}</p>
  </div>
  <!--<div>我是第二个子组件{{val}}</div>-->
</template>

<script>
/* eslint-disable no-unused-vars */

import { bus } from '../bus';

export default {
  name: 'zizujian2',
  props: ['val'],
  data() {
    return {
      msg: '我是第二个子组件22222',
    };
  },
  created() {
    bus.$on('a1', (data) => {
      this.msg = data;
    });
  },
};
</script>

<style scoped>
div{
  background: coral;
  line-height: 100px;
}
</style>
